/* AI Side Panel Styles - North American Chrome Extension Style */

.side-panel-overlay {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.4) !important;
    z-index: 2147483647 !important; /* Maximum z-index */
    backdrop-filter: blur(8px) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.side-panel {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 420px !important;
    height: 100vh !important;
    background: #ffffff !important;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.24) !important;
    display: flex !important;
    flex-direction: column !important;
    animation: slideInFromRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-left: 1px solid #e1e5e9 !important;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%) !important;
        opacity: 0 !important;
    }
    to {
        transform: translateX(0) !important;
        opacity: 1 !important;
    }
}

.side-panel-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 24px !important;
    border-bottom: 1px solid #e1e5e9 !important;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    color: white !important;
    min-height: 80px !important;
}

.header-content {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.header-icon {
    font-size: 28px !important;
    color: #fbbf24 !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)) !important;
}

.header-title {
    margin: 0 !important;
    color: white !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    letter-spacing: -0.025em !important;
}

.close-button {
    color: white !important;
    border: none !important;
    background: transparent !important;
    border-radius: 8px !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: scale(1.05) !important;
}

.side-panel-content {
    flex: 1 !important;
    padding: 24px !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    background: #fafbfc !important;
}

.success-alert {
    border-radius: 12px !important;
    border: 1px solid #10b981 !important;
    background: #ecfdf5 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.mode-card, .selection-card, .content-card {
    border-radius: 16px !important;
    border: 1px solid #e1e5e9 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    background: white !important;
    transition: all 0.2s ease !important;
}

.mode-card:hover, .selection-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-2px) !important;
}

.mode-switch-container {
    display: flex !important;
    justify-content: center !important;
    padding: 16px 0 !important;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-radius: 12px !important;
}

.mode-icon {
    font-size: 18px !important;
    color: #64748b !important;
    transition: all 0.3s ease !important;
}

.mode-icon.active {
    color: #4f46e5 !important;
    transform: scale(1.1) !important;
}

.mode-switch {
    margin: 0 20px !important;
}

.mode-switch .ant-switch {
    background: #e2e8f0 !important;
}

.mode-switch .ant-switch-checked {
    background: #4f46e5 !important;
}

.generate-button {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    height: 48px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3) !important;
    transition: all 0.2s ease !important;
}

.generate-button:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4) !important;
}

.generate-button:active {
    transform: translateY(0) !important;
}

.content-card {
    flex: 1 !important;
    min-height: 300px !important;
    max-height: 500px !important;
    overflow: hidden !important;
}

.markdown-content {
    max-height: 400px !important;
    overflow-y: auto !important;
    padding: 20px !important;
    background: #f8fafc !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 1.6 !important;
}

.markdown-content h1, .markdown-content h2, .markdown-content h3 {
    color: #1e293b !important;
    margin-top: 24px !important;
    margin-bottom: 12px !important;
}

.markdown-content p {
    color: #475569 !important;
    margin-bottom: 16px !important;
}

.markdown-content ul, .markdown-content ol {
    color: #475569 !important;
    padding-left: 20px !important;
}

.markdown-content code {
    background: #e2e8f0 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace !important;
}

.loading-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 20px !important;
    padding: 60px 20px !important;
    background: white !important;
    border-radius: 16px !important;
    border: 1px solid #e1e5e9 !important;
}

.loading-text {
    color: #64748b !important;
    font-size: 16px !important;
    font-weight: 500 !important;
}

/* Scrollbar styling for webkit browsers */
.side-panel-content::-webkit-scrollbar,
.markdown-content::-webkit-scrollbar {
    width: 8px !important;
}

.side-panel-content::-webkit-scrollbar-track,
.markdown-content::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
    border-radius: 4px !important;
}

.side-panel-content::-webkit-scrollbar-thumb,
.markdown-content::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 4px !important;
    transition: background 0.2s ease !important;
}

.side-panel-content::-webkit-scrollbar-thumb:hover,
.markdown-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

/* Ant Design component overrides */
.side-panel .ant-select {
    border-radius: 12px !important;
}

.side-panel .ant-select-selector {
    border-radius: 12px !important;
    border: 2px solid #e2e8f0 !important;
    transition: all 0.2s ease !important;
}

.side-panel .ant-select-focused .ant-select-selector {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}

.side-panel .ant-card {
    border-radius: 16px !important;
    border: 1px solid #e1e5e9 !important;
}

.side-panel .ant-card-body {
    padding: 20px !important;
}

.side-panel .ant-typography {
    color: #1e293b !important;
}

.side-panel .ant-alert {
    border-radius: 12px !important;
}

/* Responsive design for smaller screens */
@media (max-width: 480px) {
    .side-panel {
        width: 100vw !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .side-panel {
        border-left: 2px solid #000000 !important;
    }
    
    .mode-card, .selection-card, .content-card {
        border: 2px solid #000000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .side-panel {
        animation: none !important;
    }
    
    .generate-button:hover {
        transform: none !important;
    }
    
    .mode-card:hover, .selection-card:hover {
        transform: none !important;
    }
}
